<?php
/**
* 定时任务
*/
namespace app\api\controller;
use think\Controller;
use think\Request;
use think\Db;

use app\api\validate\CheckValidate;
use app\api\model\TelCode;
use app\api\model\MemberTmp;
use app\api\model\Member;
use app\api\model\Base;


class Crontab extends Controller
{
    /**
    * 每日重置用户可抽奖次数
    */
    public function setTurntableNum(){
        $baseModel = new Base;
        $sys = $baseModel->getConfig();
        $num = $sys['ONDAY_TURNTABLE_NUM'];
        $sql = "update sy_member_info set onday_turntable_num = $num";
        Db::execute($sql);
    }
    
    /**
    * 校验用户领取的任务是否超时，超时则关闭
    */
    public function closeTaskRecord(){
        $sql = "update sy_task_record set status = -1, close_info = '$close_info' where status = 1 and created < $dealine";
        
        
        $sql = "update sy_task set surplus_num = surplus_num + 1, received_num = received_num - 1  where id = $task_id";
    }
    
    /**
    * 重置每日收入收益
    */
    
    
    /**
    * 会员是否是新用户，优质客户
    */
}
